from tkinter import *

root=Tk()

def create():
    top=Toplevel()
    top.title("顶级窗口")

    msg=Message(top,text="i love you")
    msg.pack()

Button(root,text="创建顶级窗口",command=create).pack()


mainloop()
